package com.wanjia.estate.properties;

import com.wanjia.estate.constant.MockServerType;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@Configuration
@ConfigurationProperties("mock")
public class MockProxyServerProperties implements Serializable {

    private Boolean enable = true;

    private List<Config> configs;

    @Data
    public static class Config {

        private Class<?> target;

        private String method;

        private List<Class<?>> parameters = new ArrayList<>();

        private Class<?> returnType;

        private MockServerType type = MockServerType.JSON_DATA;

        private String json;

        private Resource file;
    }
}
